Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Making a transaction larger
In this section, you experiment with increasing the size of a transaction.
![]()
To see the effect of removing the
DO TRANSACTIONblock fromsaveOrder:
- Comment out the
DO TRANSACTIONstatement and the matchingENDstatement at the end of the procedure.- Recompile and generate a new listing file.
- Take a look at the final section. You can see that, without the
DO TRANSACTIONblock, the entiresaveOrderprocedure become a transaction block:
Why did this happen? A
DOblock by itself, without aTRANSACTIONorON ERRORqualifier, does not start a transaction. Therefore, Progress has to fall back on the rule that the entire procedure becomes the transaction block. In this particular case, this does not really make a big difference because the update code for Order and OrderLine is essentially the only thing in the procedure. But, as emphasized before, this is a very dangerous practice and you should always avoid it. If you generate a listing file and see that a procedure is a transaction block, you need an explicit transaction within your code. In fact, you should always have explicit transaction blocks in your code and then verify that statements outside that block are not forcing the transaction to be larger than you intend.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |